package org.fixies.utils;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 * マップイテレータ<br/>
 *
 * @author Kawasaki
 * @param <K> key
 * @param <V> value
 */
public class MapIterator<K, V> implements Iterator<V> {

    private final Iterator<Entry<K, V>> entryItr;

    public MapIterator(Map<K, V> map) {
        entryItr = map.entrySet().iterator();
    }

    public boolean hasNext() {
        return entryItr.hasNext();
    }

    public V next() {
        return entryItr.next().getValue();
    }

    public void remove() {
        entryItr.remove();
    }
}
